/**

This file is part of MaCI/GIMnet.

MaCI/GIMnet is free software: you can redistribute it and/or modify it 
under the terms of the GNU Lesser General Public License as published 
by the Free Software Foundation, either version 3 of the License, or 
(at your option) any later version.

MaCI/GIMnet is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
License for more details.

You should have received a copy of the GNU Lesser General Public 
License along with GIMnet. (See COPYING.LESSER) If not, see 
<http://www.gnu.org/licenses/>.

**/
/**
 * \file
 * \brief Name Service core header file.
 * \author Antti Maula <antti.maula@tkk.fi>
 */
#ifndef GIMNETAP_NAMESERVICECORE_H_
#define GIMNETAP_NAMESERVICECORE_H_

#include "protocol/fastProtocolHdr.h"
#include "apnameserviceframe.h"

void nameservicecoreInit(const int expected_max_names, uint32_t validMin, uint32_t validMax); 
void nameservicecoreDeinit(void); 


int nameservicecoreRequestIdByName(TAPNameServiceFrame *replyframe, 
                                   const TAPNameServiceFrame *nsframe, 
                                   const TFastProtocolHeader *fphdr);

int nameservicecoreRequestNameById(TAPNameServiceFrame *replyframe, 
                                   const TAPNameServiceFrame *nsframe, 
                                   const TFastProtocolHeader *fphdr);

int nameservicecoreRequestRegister(TAPNameServiceFrame *replyframe, 
                                   const TAPNameServiceFrame *nsframe, 
                                   const TFastProtocolHeader *fphdr);

int nameservicecoreRequestUnregister(TAPNameServiceFrame *replyframe, 
                                     const TAPNameServiceFrame *nsframe, 
                                     const TFastProtocolHeader *fphdr);

int nameservicecoreRequestUnknown(TAPNameServiceFrame *replyframe, 
                                  const TAPNameServiceFrame *nsframe, 
                                  const TFastProtocolHeader *fphdr);

#endif
